import random

import pygame

from jeo.gameobject import GameObject

class Brick(GameObject):
    def __init__(self, *args):
        super().__init__(*args)
        self.image = pygame.Surface((120, 30))
        self.color = "orange"
        self.image.fill(self.color)
        self.rect.centerx = random.randint(0, self.gameworld.width)
        self.vy = 1

    def update(self, events):
        self.rect.y += self.vy

        if self.rect.top > self.gameworld.height:
            self.kill()
